package com.yadang.service;

import org.springframework.stereotype.Service;

import javax.xml.ws.ServiceMode;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author yaDang
 * @Date 2023/11/14 20:32
 * @Version 1.0
 * @Description :
 */
@Service
public class BondLendHandleMsgFactory {

    private static final Map<String, Object> map = new HashMap<String, Object>();

    static {
        map.put("cfetsBondLB", CfetsBondLendService.class);
        map.put("SHCHBond", SHCHBondlendService.class);
    }

    public DefaultHandleService handle(String source, String type, String otherParm) {

        if ("cfets".equals(source) && "bondLb".equals(type)) {
            return new CfetsBondLendService();
        } else if ("SHCH".equals(source) && "bond".equals(type)) {
            return new SHCHBondlendService();
        } else {
            // 更多的判断逻辑
            throw new IllegalArgumentException("No handler found for " + source + "and" + source);
        }
    }
}
